/******************************************************************************
//             INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2000-2001 Intel Corporation. All Rights Reserved.
//
//  Description:
//      Intel(R) JPEG library for X platform 
//
********************************************************************************/
#include "_ijx.h"

/******************************************************************************
// Name:             ijSub128_8x8_8u16s_C1
// Description:      Convert each input sample from an unsigned representation to
//                   a two's complement representation.
// Input Arguments:
//             pSrc: Identifies image data buffer.    
//          srcStep: Specifies the number of bytes in a line within 
//                   the image data buffer.  
// Output Arguments:
//          pDst:    Identifies a output MCU buffer.
//                          
// Remarks:      
//                   1. The start address of "pDst" shall be aligned at 4byte boundary.
//                   2. It is better to do this alignment at 32byte boundary to optimize 
//                      D-Cache accessing.
//
// Returns:         
//    IPP_STATUS_OK: Succeeds.
//
******************************************************************************/
IppStatus __STDCALL ijSub128_8x8_8u16s_C1 (const Ipp8u *pSrc,
                                           int srcStep,
                                           Ipp16s *paDst[])
{
    return ippiLevelShiftSub128_8x8_8u16s_C1 (pSrc, srcStep, paDst[0]);
}

/******************************************************************************
// Name:             ijTransformFwd_MCU_16s_C1_I
// Description:      Forward transform for MCU (FDCT).
// Input Arguments: 
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//paDCTQuantTable[]: Identifies a pointer array, each of which indicates a quanization table for each component.
//
// Output Arguments:
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//                  
// Remarks:      
//                  NONE.
//
// Returns:         
//                  NONE.
//
******************************************************************************/
void ijTransformFwd_MCU_16s_C1_I (Ipp16s *paSrcDst[],
                                  const Ipp16u *paDCTQuantTable[])
{
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[0], paDCTQuantTable[0]);
}

/******************************************************************************
// Name:             ijTransformFwd444_MCU_16s_C3_I
// Description:      Forward transform for MCU (FDCT).
// Input Arguments: 
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//paDCTQuantTable[]: Identifies a pointer array, each of which indicates a quanization table for each component.
//
// Output Arguments:
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//                  
// Remarks:      
//
// Returns:         
//
******************************************************************************/
void ijTransformFwd444_MCU_16s_C3_I (Ipp16s *paSrcDst[],
                                     const Ipp16u **paDCTQuantTable)
{
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[0], paDCTQuantTable[0]);
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[1], paDCTQuantTable[1]);
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[2], paDCTQuantTable[2]);
}

/******************************************************************************
// Name:             ijTransformFwd422_MCU_16s_C3_I
// Description:      Forward transform for MCU (FDCT).
// Input Arguments: 
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//paDCTQuantTable[]: Identifies a pointer array, each of which indicates a quanization table for each component.
//
// Output Arguments:
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//                  
// Remarks:      
//
// Returns:         
//
******************************************************************************/
void ijTransformFwd422_MCU_16s_C3_I (Ipp16s *paSrcDst[],
                                     const Ipp16u **paDCTQuantTable)
{
    ippiDCTQuantFwd_Blocks_JPEG_16s_I(paSrcDst[0], 2, paDCTQuantTable[0]);
/*
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[0], paDCTQuantTable[0]);
    ippiDCTQuantFwd_JPEG_16s_I(&paSrcDst[0][64], paDCTQuantTable[0]);
*/    
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[1], paDCTQuantTable[1]);
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[2], paDCTQuantTable[2]);
}

/******************************************************************************
// Name:             ijTransformFwd411_MCU_16s_C3_I
// Description:      Forward transform for MCU (FDCT).
// Input Arguments: 
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//paDCTQuantTable[]: Identifies a pointer array, each of which indicates a quanization table for each component.
//
// Output Arguments:
//       paSrcDst[]: Identifies a pointer array, each of which indicates each plane of MCU blocks.
//                  
// Remarks:      
//
// Returns:         
//
******************************************************************************/
void ijTransformFwd411_MCU_16s_C3_I (Ipp16s *paSrcDst[],
                                   const Ipp16u **paDCTQuantTable)
{
    ippiDCTQuantFwd_Blocks_JPEG_16s_I(paSrcDst[0], 4, paDCTQuantTable[0]);
/*
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[0], paDCTQuantTable[0]);
    ippiDCTQuantFwd_JPEG_16s_I(&paSrcDst[0][64], paDCTQuantTable[0]);
    ippiDCTQuantFwd_JPEG_16s_I(&paSrcDst[0][128], paDCTQuantTable[0]);
    ippiDCTQuantFwd_JPEG_16s_I(&paSrcDst[0][192], paDCTQuantTable[0]);
*/
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[1], paDCTQuantTable[1]);
    ippiDCTQuantFwd_JPEG_16s_I(paSrcDst[2], paDCTQuantTable[2]);
}


/* EOF */
